﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FreesenseSubAIS.Core
{
    internal abstract class ImageGeneratorBase 
    {
        /// <summary>
        /// 图像回调
        /// </summary>
        public event Action<Bitmap> ImageReady;

        /// <summary>
        /// 异步请求图像
        /// </summary>
        /// <returns></returns>
        public bool AquireBitmap()
        {
            Task.Run(() => ImageReady(Generate()));
            return true;
        }
        /// <summary>
        /// 生成一张图像
        /// </summary>
        /// <returns></returns>
        public abstract Bitmap Generate();

    }
}
